const express = require("express")
const router = express.Router()

// 引入控制层
const Permiss = require("../controllers/Permission")

// 引入中间件
const checkPermission = require('../middleware/checkPermission');
const auth = require('../middleware/auth');

router.get('/findByPk',auth,Permiss.findByPk)
router.post('/add',auth,checkPermission('permiss_add'),Permiss.create)
router.get('/del_t',auth,checkPermission('permiss_delete'),Permiss.del_permis_t)
router.post('/set',auth,checkPermission('permiss_edit'),Permiss.permis_set)
router.get('/list',auth,checkPermission('permiss_list'),Permiss.permis_list_c)
router.get('/all',auth,checkPermission('permiss_list'),Permiss.permis_all)


router.get('/roles_get',auth,checkPermission('permiss_list'),Permiss.roles_get)
router.get("/roles_set", auth, checkPermission('pression_set'), Permiss.roles_set)


module.exports = router